﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Runtime.Serialization;

namespace CNShapes
{
    /// <summary>
    /// This class is a base class for shapes that use a Pen for drawing.
    /// It holds the details of the pen.
    /// </summary>
    [DataContract]
    public abstract class ShapeBase_DrawnWithPen : Shape
    {
        #region Public properties

        /// <summary>
        /// Property to get or set the pen width.
        /// </summary>
        public float PenWidth
        {
            get
            {
                return m_fPenWidth;
            }
            set
            {
                m_fPenWidth = value;
                raiseShapeEditedEvent();
            }
        }

        /// <summary>
        /// Property to get or set the pen color.
        /// </summary>
        public Color PenColor
        {
            get
            {
                return m_PenColor;
            }
            set
            {
                m_PenColor = value;
                raiseShapeEditedEvent();
            }
        }

        #endregion

        #region Protected data

        // Pen width and color...
        [DataMember]
        protected float m_fPenWidth = 3;
        [DataMember]
        protected Color m_PenColor = Color.Blue;

        #endregion
    }
}
